<template>
    <div class="teamWrap">
        <div class="title">团队成员</div>
<!-- Table goes in the document BODY -->
  <router-link  to="/open/team/Add"><button class="new">新增成员+</button></router-link>
    <div class="accountCOntent">
      <table class="hovertable">
<tr>
  <th>序号</th><th>账户名</th><th>用户姓名</th><th>职位</th><th>操作</th>
</tr>
<tr onmouseover="this.style.backgroundColor='rgb(236,236,236)';" onmouseout="this.style.backgroundColor='#fff';" v-for="(item,index) in userData">
  <td>{{item.id}}</td><td>{{item.phone}}</td><td>{{item.name}}</td><td>{{item.job}}</td><td><el-button size="mini" @click="handleEdit(index)" icon="el-icon-edit">编辑</el-button></td>
</tr>
</table>
    </div>
    </div>
</template>

<script>
    export default {
        activated(){
            this.getUserList()
        },
        data() {
      return {
        isMainAccount:false,
        userData:[],
        border:true
      }
    },
    methods: {
      handleEdit(index) {
        this.$router.push({path:'/open/team/Edit/'+this.userData[index].id})
      },
      getUserList(){
        this.$http.post(this.$store.getters.serverIp+'get_userlist',{token:localStorage.getItem('token')}).then((response)=>{
            if(response.data.success){
                this.userData=response.data.data
                this.isMainAccount=response.data.type
            }
        })
      }
    }
    }
</script>
<style lang="less" >
    .teamWrap{
        .el-table{
            width: 54% !important;
            margin: 0 auto !important;
            .is-leaf {
                border-bottom: 1px solid #c2cbe2 !important;
                text-align: center;
            }
            .cell{
                text-align: center !important;
            }
        }
        .el-table__header-wrapper{
        font-size: 22px !important;
        }
        tr.el-table__row {
            font-size: 18px;
        }
    }
    .accountCOntent{
      padding: 3%;
    }
</style>>